hvm: unset_mm_mapping() for vga acceleration region should recalculate
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Fri, 23 Feb 2007 16:16:36 +0000 (16:16 +0000)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Fri, 23 Feb 2007 16:16:36 +0000 (16:16 +0000)
maxmem setting before freeing memory!
Signed-off-by: Keir Fraser <keir@xensource.com>
tools/ioemu/vl.c

index ed29028d412619e9540215a366e4b3987a1e3715..bf6392058ddea3bb568a4d8e2ba5acbab1ee28e4 100644 (file)
@@ -5768,18 +5768,18 @@ int unset_mm_mapping(int xc_handle, uint32_t domid,
     int err = 0;
     xc_dominfo_t info;
 
-    err = xc_domain_memory_decrease_reservation(xc_handle, domid,
-                                                nr_pages, 0, extent_start);
-    if (err)
-        fprintf(stderr, "Failed to decrease physmap\n");
-
     xc_domain_getinfo(xc_handle, domid, 1, &info);
-
     if ((info.nr_pages - nr_pages) <= 0) {
         fprintf(stderr, "unset_mm_mapping: error nr_pages\n");
         err = -1;
     }
 
+    err = xc_domain_memory_decrease_reservation(xc_handle, domid,
+                                                nr_pages, 0, extent_start);
+    if (err)
+        fprintf(stderr, "Failed to decrease physmap\n");
+
+
     if (xc_domain_setmaxmem(xc_handle, domid, (info.nr_pages - nr_pages) *
                             PAGE_SIZE/1024) != 0) {
         fprintf(logfile, "set maxmem returned error %d\n", errno);